<template>
	<view class="content">
		<!-- 订单金额 -->
		<view class="c-row fisrt-row-top">
			<view class="r-lb">{{orderMonTxt}}</view>
			<view class="r-lb p-txt">{{tabTotal.amountOrderPrice}}</view>
			<view class="r-lb rlb-tip-txt"><text>({{"原价 " + tabTotal.amountTotle}}</text><text>{{"折扣 " + tabTotal.discount}}%</text><text>{{"优惠 " +tabTotal.preferential}})</text></view>
		</view>
		
		<!-- 实付金额 -->
		<view class="c-row">
			<view class="r-lb">{{netReceiptsTxt}}</view>
			<input class="n-r-Mon"  
				:value="tabTotal.netReceiVal" 
				:placeholder="netReceiptsTip"
				@input="netRecValInput" 
				type="number"/>
		</view>
		
		
		
		<!-- 余额结算 -->
		<view class="c-row" v-if="orderType == 1 && customMoney > 0">
			<view class="r-lb">{{customMoneyTxt}}</view>
			<view class="r-lb p-txt">{{customMoney}}</view>
			<switch class="uni-list-cell-db" :checked="isUseMoney" @change="onMoneyChange"></switch>
		</view>

		
		
		<!-- 费用 -->
		<view class="c-row" v-show="setSellData.is_fee == 1">
			<view class="r-lb rlb-right-e">{{outlayTxt}}</view>
			<view class="r-lb n-r-Mon-e r-lb-w">{{addTxt}}</view>
			<view class="r-lb n-r-Mon-e">
				<text class="icon-font icon-style" @click="onClickOutlay">&#xe600;</text>
			</view>
		</view>

		<!-- 付款方式 -->
		<view class="c-row no-line" v-show='tabTotal.netReceiVal > 0'>
			<view class="r-lb">{{orderType == 1? payTypeTxt:"退款方式"}}</view>
			<dropdownMenu
			ref="padyTypeDrop"
			:descObj="payTypeSelctData"
			:list="payTypeList"
			@changeMenu="selectedPayTypeData"></dropdownMenu>
		</view>
		
		<!-- 出/入库仓库 -->
		<view class="c-row no-line">
			<view class="r-lb">{{inStoreTxtLb}}</view>
			<dropdownMenu
				ref="storeMenu"
				:descObj="curStore"
				:list="storeList"
				@changeMenu="setStore">
			</dropdownMenu>
			<view class="addr-txt" v-if="cStoreAddres != '' ">{{addrTxt + " " + cStoreAddres}}</view>
		</view>
		
		<!-- 经手人 -->
		<view class="c-row no-line" v-show="limitBillChangeManger && setSellData.is_seller == 1">
			<view class="r-lb rlb-right">{{dealerTxt}}</view>
			<dropdownMenu
			ref="ucpMenu"
			:descObj="curUcp"
			:list="ucpList"
			@changeMenu="setUcp"></dropdownMenu>
		</view>
		
		<!-- 业务时间 -->
		<view class="c-row no-line c-row-noceter" v-show="limitBillChangeTime">
			<view class="r-lb">{{timeTxt}}</view>
			<datePicker 
				@changeTime="onTimeChange">
			</datePicker>
		</view>
		
		<!-- 备注 -->
		<view class="c-row c-row-noceter c-row-p-b" v-show="setSellData.is_txt == 1">
			<view class="r-lb">{{remarksTxt}}</view>
			<view class="input-photo-box">
				<input class="remask-input"
					:value="remarskValue" 
					:placeholder="remarksTxtTip"
					type="text"
					maxlength="200"
					@input="remarskValInput" />
				<addPhoto ref="addPhoto"></addPhoto>
				<label class="y-p-c-t">
					<checkbox :checked="isAllowView" @click="changeAllowView"/>{{remarkIsViewTxt}}
				</label>
			</view>
		</view>
	
		<!-- 是否打印 -->
		<view class="c-row no-line last-row-bottom">
			<view class="r-lb  rlb-right-e">{{printTxt}}</view>
			<label class="y-p-c-t" v-if="isHasYunPrint" @click="changePrint">
				<checkbox :checked="isPrint"/>{{yunPrintTxt}}
			</label>
			<label class="y-p-c-t" @click="changeLocalPrint">
				<checkbox :checked="isLocalPrint" />{{localPrintTxt}}
			</label>
		</view>
		
		<!-- 编辑图片 -->
		<imageCropper ref="imageCropper" 
			:src="editUrl" 
			:curEditType="curEditType"
			@confirm="confirm" 
			@cancel="cancel">
		</imageCropper> 
		
		<!-- 添加费用窗口 -->
		<outlayWin ref="outlayWin" 
			:setSellData="setSellData" 
			@feeSure="feeSure">
		</outlayWin>
		
		<!-- 选择打印仓库 -->
		<selecShopAndStore ref="selecShopAndStore"></selecShopAndStore>
	</view>	
</template>

<script>
	import lang from "../../js/conf/Lang.js";
	
	import dropdownMenu from "../comm/DropdownMenu.vue";
	
	import datePicker from "../comm/dateTimePicker.vue";
	
	import addPhoto from "../comm/AddPhoto.vue";
	
	import imageCropper from "../comm/ImageCropper.vue";
	
	import pickerRegion from "../comm/picker-region/picker-region.vue";
	
	import outlayWin from "../comm/OutlayWin.vue";
	
	import selecShopAndStore from "../comm/SelecShopAndStore.vue";
	
	import staticConst from "../../js/const/StaticConst.js";
	
	import eventCtrl from "../../js/event/EventCtrl.js";
	
	import uploadPic from "../../js/upload/UploadPic.js";
	
	import https from "../../js/https/Https.js";
	
	import regionCtrl from "../../js/region/RegionCtrl.js";
	
	import util from "../../js/util/Util.js";
	
	import localStore from "../../js/LocalStore.js";
	
	const ONLINE_PAY = 1000;
	export default
	{
		props:["isHasYunPrint","orderType","supplierInfo","setSellData","limitBillChangeManger","limitBillChangeTime"],
		components:{dropdownMenu,
					datePicker,
					addPhoto,
					imageCropper,
					pickerRegion,
					outlayWin,
					selecShopAndStore},
		data()
		{
			return{
				title:lang.purchaseCheckOut.title,
				
				sendGoodsList : [],
				
				sendGoosTypeObj : {},
				
				consigneeVal　:　"",
				
				phoneVal : "",
				
				areaObj : 
				{
					addressee:"",//收货人
					cellphone:"",//电话
					province:"",//省
					city:"",//市
					area:"",//区
					district:"",//省，市，区
					address:"",//地址
				},
				defaulArea : null,
				
				addressVal:"",
				
				orderMonTxt:lang.purchaseCheckOut.orderMonTxt,
				oPriceTxt : lang.purchaseCheckOut.oPriceTxt,
				discoutTxt : lang.purchaseCheckOut.discoutTxt,
				preferentialTxt : lang.purchaseCheckOut.preferentialTxt,
				tabTotal:{},
				
				netReceiptsTxt:lang.purchaseCheckOut.netReceiptsTxt,
				netReceiptsTip:lang.purchaseCheckOut.netReceiptsTip,
				
				payTypeTxt:lang.purchaseCheckOut.payTypeTxt,
				payTypeTip:lang.purchaseCheckOut.payTypeTip,
				payTypeList:[], //支付方式列表
				payTypeSelctData : {},//当前选中的支付方式
				
				customMoneyTxt : lang.purchaseCheckOut.customMoneyTxt,
				customMoney : 0,//客户余额
				isUseMoney : false, //是否使用余额结算
				
				
				orderStoreTxt : lang.purchaseCheckOut.orderStoreTxt, //出库仓库
				inStoreTxtLb:lang.purchaseCheckOut.inStoreTxtLb,//入库仓库
				curStore:{},
				storeList : [],
				cStoreAddres:'',
				
				addrTxt:lang.purchaseCheckOut.addrTxt,
				
				timeTxt:lang.purchaseCheckOut.timeTxt,
				
				dealerTxt : lang.purchaseCheckOut.dealerTxt,
				
				remarksTxt : lang.purchaseCheckOut.remarksTxt,
				
			    ucpList : [],
				curUcp : {}, //当前经手
				timeValue : "",
				
				remarksTxtTip:lang.purchaseCheckOut.remarksTxtTip,
				remarskValue:"",
				remaskPhoArr:[{url:"",imgs_base:"",imgs:"",isDel:false}],
				editUrl:"",
				curEditType : staticConst.UPLOAD_REMASK,    //
				
				printTxt:lang.printTxt,
				isPrint:false,
				
				//费用
				outlayTxt : lang.outlay.outlayTxt,
				addTxt : lang.outlay.addTxt,
				useFeeList : [], //选择的费用列表。
				isAllowView : false,
				remarkIsViewTxt : lang.purchaseCheckOut.remarkIsViewTxt,
				
				yunPrintTxt : lang.yunPrintTxt,
				localPrintTxt : lang.localPrintTxt,
				isLocalPrint : false,
				printStoreId : "",
			}
		},

		methods:
		{
			/****初始化数据*****/
			async initData(tabTotal,data,ucpList)
			{
				this.clearData();
				this.removeAndAddEvent();
				// this.$refs.pickerRegion.initData();
				this.setConsigneeInfo(data);
				this.setSendGoodsType(data);
				this.tabTotal = tabTotal;
				this.customMoney = data.money;
				this.setPayType(data);
				this.setStoresListData(data);
				this.ucpList = ucpList;
				this.setCurUcpValue(data,ucpList);
				this.setRemaketPhoto(data);
				this.setFeeInfo(data);
				
				// 获取缓存的支付方式
				// let value =  await localStore.getPaymentType();
				// if(value)
				// 	this.selectedPayTypeData(value);
			},
			
			/*****设置费用弹出数据*****/
			setFeeInfo(data)
			{
				this.useFeeList = [];
				if(data.init_info)
				{
					if(data.init_info.fee_info && data.init_info.fee_info && data.init_info.fee_info.fee_ls)
					{
						let arr = data.init_info.fee_info.fee_ls;
						let len = arr.length;
						for(let i = 0; i < len; i++)
						{
							let obj = arr[i];
							let temp = {};
							temp.id = obj.id;
							temp.title = obj.title;
							temp.fee = obj.fee;
							temp.cdo = obj.cdo;
							temp.payid = obj.payid;
							temp.paytitle = obj.paytitle;
							this.useFeeList.push(temp);
						}
					}
				}
				this.$refs.outlayWin.initData(this.useFeeList,this.addTxt,this.payTypeList);
			},
			
			/***选中了费用***/
			feeSure(data)
			{
				this.addTxt = data.addTxt;
				this.useFeeList = [];
				let arr = data.list;
				let len = arr.length;
				for(let i=0; i<len; i++)
				{
					let obj = arr[i];
					let temp = {};
					temp.id = obj.id;
					temp.title = obj.title;
					temp.fee = obj.fee;
					temp.cdo = obj.cdo;
					temp.payid = obj.payid;
					temp.paytitle = obj.paytitle;
					this.useFeeList.push(temp);
				}
				this.tabTotal.amountFee = data.feeTotal;
				this.tabTotal.amountOrderPrice = util.decimalPlaceCount(Number(this.tabTotal.amountOrPri) + Number(data.feeTotal),this.setSellData.money_p);
				this.tabTotal.netReceiVal = this.tabTotal.amountOrderPrice;
			},
			
			/****清除数据*****/
			clearData()
			{
				this.sendGoodsList = [];
				this.sendGoosTypeObj = {};
				this.consigneeVal　=　"";
				this.phoneVal = "";
				this.areaObj = {
					addressee:"",//收货人
					cellphone:"",//电话
					province:"",//省
					city:"",//市
					area:"",//区
					district:"",//省，市，区
					address:"",//地址
				};
				this.defaulArea = null;
				this.addressVal = "";
				
				this.tabTotal = {};
				this.payTypeList = []; //支付方式列表
				this.payTypeSelctData = {};//当前选中的支付方式
				this.customMoney = 0;//客户余额
				this.isUseMoney = false; //是否使用余额结算
				this.curStore = {};
				this.storeList = [];
				this.cStoreAddres = '';
				this.ucpList = [];
				this.curUcp = {}; //当前经手
				this.timeValue = "";
				this.remarskValue = "";
				this.remaskPhoArr = [{url:"",imgs_base:"",imgs:"",isDel:false}];
				this.editUrl = "";
				this.isPrint = false;
				this.useFeeList = [];
				this.isAllowView = false;
				this.isLocalPrint = false;
				this.printStoreId = "";
			},
			
			/****点击添加费用****/
			onClickOutlay()
			{
				this.$refs.outlayWin.show("show");
			},
			
			/****选取发货方式*****/
			changeSendGoodsType(item)
			{
				this.sendGoosTypeObj = item;
			},
			
			/****设置发货方式****/
			setSendGoodsType(data)
			{
				if(data.shipp_ls)
				{
					this.sendGoodsList = data.shipp_ls;
					this.sendGoosTypeObj = this.sendGoodsList[1];
				}
			},
			
			/*****设置收货人信息****/
			setConsigneeInfo(data)
			{
				if(data.address_info)
				{
					data = data.address_info;
					this.areaObj.addressee = this.consigneeVal　=　data.addressee;
					this.areaObj.cellphone = this.phoneVal = data.cellphone;
					this.areaObj = {
						addressee:data.addressee,//收货人
						cellphone:data.cellphone,//电话
						province:data.province,//省
						city:data.city,//市
						area:data.area,//区
						district:data.district,//省，市，区
						address:data.address,//地址
					};
					// this.defaulArea = null;
					this.areaObj.address = this.addressVal = data.address;
				}
			},
			
			/***输入收货人***/
			consignVal(e)
			{
				this.areaObj.addressee = this.consigneeVal = e.target.value;
			},
			
			/****输入电话****/
			inputPhone(e)
			{
				this.areaObj.cellphone = this.phoneVal = e.target.value;
			},
			
			areaChange(province,city,area)
			{
				if(province)
				{
					this.areaObj.province = province.code;
					this.areaObj.district = province.name;
				}
				if(city)
				{
					this.areaObj.city = city.code;
					this.areaObj.district =this.areaObj.district+ "," + city.name
				}
				if(area)
				{
					this.areaObj.area = area.code;
					this.areaObj.district = this.areaObj.district + "," + area.name; 
				}
			},

			/***输入地址*****/
			inputAddress(e)
			{
				this.areaObj.address = this.addressVal = e.target.value;
			},
			
			//时间选择变更
			onTimeChange(str) {
				this.timeValue = str;
			},
			
			/****设置支付方式***/
			setPayType(data)
			{
				this.payTypeSelctData = {id:-1,title:this.payTypeTip};
				if(data.init_info && data.init_info.payid)
				{
					this.payTypeSelctData.id = data.init_info.payid;
				}
				
				this.$refs.padyTypeDrop.setCurId(this.payTypeSelctData.id);
				
				if(data.pay_ls_sys) //在线支付方式
				{
					let len = data.pay_ls_sys.length;
					for(let i = 0; i<len; i++)
					{
						let obj = data.pay_ls_sys[i];
						
						
						let temp = {};
						temp.id = obj.payid;
						temp.title = obj.title;
						temp.payType = obj.paytype;
						if(temp.id == this.payTypeSelctData.id)
						{
							 this.payTypeSelctData.title = temp.title; 
						}
						this.payTypeList.push(temp);
					}
				}
				if(data.pay_ls) //自定义支付方式，只是标记作用
				{
					let len = data.pay_ls.length;
					for(let i = 0; i<len; i++)
					{
						let obj = data.pay_ls[i];
						if(obj.status != 1)continue;
						let temp = {};
						temp.id = obj.id;
						temp.title = obj.title;
						if(temp.id == this.payTypeSelctData.id)
						{
							 this.payTypeSelctData.title = temp.title; 
						}
						this.payTypeList.push(temp) ;
					}
				}

			},
			
			/****设置当前经手人****/
			setCurUcpValue(data)
			{
				if(data.user_ls)
				{
					if(data.user_ls.length > 0)
					{
						let obj = {};
						obj.id = data.user_ls[0].uid;
						obj.title = data.user_ls[0].uname;
						this.curUcp = obj;
						this.$refs.ucpMenu.setCurId(this.curUcp.id);
					}
				}
			},
			
			/*****更改经手人******/
			setUcp(item)
			{
				this.curUcp = item;
			},
			
			/****设置仓库数据****/
			setStoresListData(data)
			{
				this.storeList.push({title:"暂不入库",id:-1});
				let curStoreId = "";
				
				if(data.init_info && data.init_info.storeid != 0)
				{
					curStoreId = data.init_info.storeid;
				}
				
				if(data.store_ls)
				{
					let len  = data.store_ls.length;
					for(let i = 0; i<len; i++)
					{
						let obj = data.store_ls[i];
						let temp = {};
						temp.address = obj.address;
						temp.area = obj.area;
						temp.atime = obj.atime;
						temp.base = obj.base;
						temp.cellphone = obj.cellphone;
						temp.city = obj.city;
						temp.code_s = obj.code_s;
						temp.cpid = obj.cpid;
						temp.district = obj.district;
						temp.etime = obj.etime;
						temp.id = obj.id;
						temp.imgs = obj.imgs;
						temp.isas = obj.isas;
						temp.issell = obj.issell;
						temp.title = obj.name;
						temp.province = obj.province;
						temp.status = obj.status;
						temp.txt = obj.txt;
						temp.uid = obj.uid;
						temp.uid_m = obj.uid_m;
						
						if(curStoreId == temp.id)
						{
							this.curStore = temp;
						}
						this.storeList.push(temp);
					}
					if(curStoreId == "")
						this.curStore = this.storeList[0];
					this.setStoreAddress();
					this.$refs.storeMenu.setCurId(this.curStore.id);
				}
			},
			
			/****更仓库***/
			setStore(item)
			{
				if(item)
				{
					this.curStore = item;
					this.setStoreAddress();
				}
			},
			
			/***设置仓库地址***/
			setStoreAddress()
			{
				if(this.curStore)
				{
					this.cStoreAddres = '';
					if(this.curStore.district)
					{
						this.cStoreAddres = this.curStore.district; 
					}
					if(this.curStore.address)
					{
						this.cStoreAddres = this.cStoreAddres + " " + this.curStore.address; 
					}
				}
				else
				{
					this.cStoreAddres = '';
				}
			},
			
			/****选择支付方式****/
			selectedPayTypeData(item)
			{
				this.payTypeSelctData = item;
				this.tabTotal.payTypeTxt = item.title;
				localStore.savePaymentType(item);//存储本地
			},
			
			/*****输入实收金额******/
			netRecValInput(event)
			{
				this.tabTotal.netReceiVal = event.target.value;
				if(this.tabTotal.netReceiVal == "" || Number(this.tabTotal.netReceiVal) <= 0 )
				{
					this.tabTotal.netReceiVal = 0;
				}
			},
			
			/****设置是否使用余额结算***/
			onMoneyChange(event)
			{
				this.isUseMoney = event.detail.value;
			},
			
			/***输入备注值*****/
			remarskValInput(e)
			{
				this.remarskValue = e.target.value;
			},
			
			/***初始化备注图片数据***/
			setRemaketPhoto(data)
			{
				let obj = {};
				
				if(data.init_info && data.init_info.txt_ls && data.init_info.txt_ls[0])
				{
					let temp = data.init_info.txt_ls[0];
					if(temp.txt)
						this.remarskValue = temp.txt;
					this.isAllowView = temp.isopen == 1 ? true:false;
					if(temp.imgs && temp.imgs.length > 0)
					{
						this.remaskPhoArr = [];
						let tempArr = temp.imgs;
						let len = tempArr.length;
						for(let i = 0; i<len; i++)
						{
							let imgs = tempArr[i];
							let t = {};
							t.url = imgs.img_s;
							t.imgs_base =  imgs.img_0;
							t.imgs = imgs.img_b;
							t.isDel = false;
							this.remaskPhoArr.push(t);
						}
						
						if(this.remaskPhoArr.length < 9)
						{
							this.remaskPhoArr.push({url:"",imgs_base:"",imgs:"",isDel:false});
						}
					}
				}
				
				obj.list = this.remaskPhoArr;
				obj.type = this.curEditType;
				this.$refs.addPhoto.initPhotoData(obj);
			},
			
			/***编辑图片***/
			editPhoto(data)
			{
				this.editUrl = data.url;
			},
			
			/*****确认编辑图片****/
			confirm(data)
			{
				this.$refs.addPhoto.confirm(data,this.uploadPicSuccess);
			},
			
			/*****上传图片成功*****/
			uploadPicSuccess(index,name)
			{
				this.remaskPhoArr[index].imgs_base = name;
			},
			
			/*****提交数据获取备注图片****/
			submitDataGetMPArr()
			{
				let arr = [];
				for(let i = 0; i<this.remaskPhoArr.length; i++)
				{
					let obj = this.remaskPhoArr[i];
					if(obj.imgs_base != "")
					{
						arr.push(obj.imgs_base);
					}
				}
				return arr;
			},
			
			/****取消编辑图片*****/
			cancel()
			{
				this.$refs.addPhoto.cancel();
			},
			
			/****是否允许对客户可见****/
			changeAllowView()
			{
				this.isAllowView = !this.isAllowView;
			},
			
			/***设置是否打印****/
			changePrint()
			{
				this.isPrint = !this.isPrint;
				if(this.isPrint)
				{
					if(this.curStore.id == -1) //未选择仓库，弹出选择打印仓库，选择打印机位置
					{
						let data = {};
						let list = JSON.parse(JSON.stringify(this.storeList));
						list.shift();
						data.titleType = 1;
						data.curId = this.curStore.id;
						data.data = list;
						data.callBack = this.selectStoreId;
						this.$refs.selecShopAndStore.showWin("show",data);
					}
				}
			},
			
			/****根据仓库，选择打印机****/
			selectStoreId(id)
			{
				this.printStoreId = id;
			},
			
			/*****勾选使用本地打印*****/
			changeLocalPrint()
			{
				this.isLocalPrint = !this.isLocalPrint;
			},
			
			/***完成开单，结账提交，****/
			finishOrder(backup)
			{
				
				if( Number(this.tabTotal.netReceiVal) > 0 && this.payTypeSelctData.id == -1)
				{
					this.$msg({title:lang.purchaseCheckOut.finishOrderTip});
					return;
				}
				
				let that = this;
				let param = {};
				if(backup) //草稿
					param.backup = backup;
				param.amount = this.tabTotal.totalPrice;//产品金额(折后)
				param.amount_receive = this.tabTotal.netReceiVal;//	实收金额，无结账权限不传
				param.ispay_end = Number(this.tabTotal.netReceiVal) >= Number(this.tabTotal.amountOrderPrice) ? 1 : 0;//是否付清款，1是0否，1=（实付>=(应付+邮费)）
				param.amount_od = this.tabTotal.amountOrderPrice;//订单应收金额，含邮费及费用
				if(this.isUseMoney && this.customMoney > 0)
				{
					param.money = this.customMoney;//使用客户余额，不使用则不传该参数，退款单不可使用
				}
				
				if(this.payTypeSelctData.id >= ONLINE_PAY) //标识性支付方式
				{
					param.payid = this.payTypeSelctData.id ;//收款帐户/收款方式
				}
				else
				{
					//线上支付
					param.amount_receive = 0; //线上支付等于是欠款
					param.ispay_end = 0;//是否付清款，1是0否，1=（实付>=(应付+邮费)）
				}
				
				param.atime_txt = this.timeValue;//业务时间，格式示例2020-03-08；空或不传则系统默认当前时间
				param.uid_cp = this.curUcp.id;//	经手人
				param.txt = this.remarskValue;//备注内容
				param.txt_imgs = this.submitDataGetMPArr();//备注图片，相对路径，类型=数组，例如[abc/123.jpg,abc/1234.jpg]
				param.isprint = this.isPrint ? 1 : 0;//	打印，1是，其他否
				if(this.curStore.id != -1)
				{
					param.storeid = this.curStore.id;//出库仓库
				}
				else
				{
					if(param.isprint == 1)
						param.storeid_print = this.printStoreId;
				}
				
				param.isopen = this.isAllowView ? 1 : 2 //备注内容客户是否可见 1:可见 2：不可见
				if(this.supplierInfo && this.supplierInfo.id)
				{
					param.shipp_type = this.sendGoosTypeObj.id;//发货方式
					// param.amount_shipp = //物流送货费
					param.shipp_info = this.areaObj;
				}
				
				if(this.useFeeList && this.useFeeList.length > 0)
				{
					param.fee_ls = this.useFeeList;
				}
				
				https.cgOrderAdd(param,back);
				function back(data)
				{
					if(!data)return;
					if(data.status == 1)
					{
						if(!data.data)return;
						data = data.data;
						let obj = {};
						obj.isOnlinePay = false;
						obj.isLocalPrint = that.isLocalPrint;
						obj.odid = data.odid;
						let amountNotpay = data.amount_notpay;
						if(that.orderType == 1 
							&& amountNotpay > 0 
							&& that.payTypeSelctData.id != -1 
							&& that.payTypeSelctData.id < ONLINE_PAY)
						{
							that.payTypeSelctData
							obj.isOnlinePay = true;
							obj.odno = data.odno;
							obj.printer = data.printer;
							obj.type = data.type;
							obj.id = that.payTypeSelctData.id;
							obj.payType = that.payTypeSelctData.payType;
							obj.money_pay = that.tabTotal.netReceiVal;
							obj.backup = backup;
						}
						that.retData();
						that.$emit("finishOrderBack",obj); //结算差
					}
				}
			},
			
			retData()
			{
				this.addTxt = lang.outlay.addTxt;
				this.$refs.outlayWin.clearData();
			},
			
			/***注册事件*****/
			addEvent()
			{
				uni.$on(eventCtrl.EDIT_MASKER_PHOTO_EVENT,this.editPhoto); //编辑图片
			},
			
			/***删除事件*****/
			removeEvent()
			{
				uni.$off(eventCtrl.EDIT_MASKER_PHOTO_EVENT); //编辑图片
			},
			
			/****注册删除事件*****/
			removeAndAddEvent()
			{
				this.removeEvent();
				this.addEvent();
			},
		},
	}
</script>

<style lang="less">
	.content
	{
		padding: 10px 15px;
		font-size: 16px;
		.c-row
		{
			color: #333;
			display: flex;
			align-items: center;
			padding-top: 20px;
			border-bottom: 1px solid #f2f2f2;
			.r-lb
			{
				padding-right: 30px;
				.icon-style
				{
					font-size: 16px;
					padding-right: 10px;
					cursor: pointer;
					opacity: .8;
				}
				.icon-style:hover
				{
					opacity:1;
				}
			}
			.p-txt ,.n-r-Mon
			{
				font-weight: bold;
			}
			
			.n-r-Mon-e
			{
				font-weight: none;
			}
			
			
			.p-t-tip
			{
				color: #AAA;
				cursor: pointer;
			}
			
			.p-icon
			{
				font-size: 18px;
			}
			
			.addr-txt
			{
				padding-left: 20px;
				color: #999;
			}
			
			.rlb-right
			{
				padding-right: 46px;
			}
			
			.rlb-right-e
			{
				padding-right: 60px;
			}
			
			.rlb-tip-txt
			{
				color:  #F04848;
				text
				{
					padding-left: 20px;
				}
			}
			
			
			.input-photo-box
			{
				width: 100%;
				width: calc(100% - 100px);
				.remask-input
				{
					border: 1px solid #ECECEC;
					padding: 10px;
				}
				.remark-v-b
				{
					display: flex;
					align-items: center;
				}
			}
			
			.r-lb-w
			{
				width : 258px;
			}
			
			
			switch
			{
				transform: scale(.8, .8);
				padding-left: 145px;
			}
			
			.y-p-c-t
			{
				padding-right: 15px;
				line-height: 24px;
			}
		}
		
		.c-row-p-b
		{
			padding-bottom: 10px;
		}
		
		.c-row-noceter
		{
			align-items : baseline;
		}
		
		.fisrt-row-top
		{
			padding-top: 10px;
		}
		
		.fisrt-row-top-e
		{
			padding-top: 25px;
		}
		
		.last-row-bottom
		{
			padding-bottom: 30px;
		}
		
		.no-line
		{
			border-bottom: none;
		}
	}
</style>
